#include "threadpool.hpp"
#include "task.hpp"
#include <unistd.h>
#include <iostream>
#include <ctime>
using namespace std;

int main()
{
    srand(time(0));
    threadpool<Task> tp(10);
    tp.Start(); // 启动线程池
    int len = opers.size();
    // 创建任务
    while (true)
    {
        int data1 = rand() % 10 + 1;
        char oper = opers[rand() % len];
        int data2 = rand() % 10;
        Task t(data1, data2, oper);
        tp.Push(t);
        usleep(50000);
    }

    return 0;
}